﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.Entitys.Pinv
{
    public class Pb_details_Order
    {
        public int? Pb_id { get; set; } // 采购订单ID，主键
        public string? Pb_code { get; set; } // 采购入库编号
        public int? Po_id { get; set; } // 采购订单ID，外键
        public string? Po_name { get; set; } // 采购订单名称，外键
        public string? Po_code { get; set; } // 采购订单编号，外键
        public string? Vendor_name { get; set; } // 供应商名称
        public string? Vendor_code { get; set; } // 供应商编码
        public string? Contacts_name { get; set; } // 联系人姓名
        public string? Contacts_phone { get; set; } // 联系人电话
        public int? Po_rep_id { get; set; } // 负责人ID
        public DateTime? Po_Starttime { get; set; } // 采购订单签约时间
        public decimal? Po_quantity_purchased { get; set; }//总数量
        public int? Po_dept_id { get; set; } // 负责人部门ID
        public int? Po_state { get; set; } // 订单状态（数字或代码）
        public char? Pb_eligibility { get; set; } // 是否合格，多余了
        public DateTime? Pb_Inboundtime { get; set; } // 入库时间
        public string? Pb_operator { get; set; } // 操作员
        public char? Pb_Audit { get; set; } // 是否审核
        public string? Pb_Audit_By { get; set; } // 审核人
        public DateTime? Pb_Audit_Time { get; set; } // 审核时间
        public string? Pb_Audit_Remark { get; set; }//审核备注
        public string? Remark { get; set; } // 备注信息
        public string? Create_by { get; set; } // 创建人
        public DateTime? Create_time { get; set; } // 创建时间
        public string? Update_by { get; set; } // 更新人
        public DateTime? Update_time { get; set; } // 更新时间
        public char? Del_flag { get; set; } // 删除标志（0-正常，1-已删除）
        public string? Warehouse_code { get; set; } // 仓库编码
        public string? Zone_code { get; set; } // 区域编码

        public List<details> Details { get; set; }

        public class details
        {
            public int? Purwhsedetail_id { get; set; }// 采购入库明细ID，主键
            public int? Pb_id { get; set; }//采购订单ID
            public string? Pb_code { get; set; }//采购订单编号
            public string? Pro_name { get; set; }//产品名称
            public string? Pro_code { get; set; }//产品编码
            public int? Unitmeas_id { get; set; }//计量单位ID
            public string? Pro_brand { get; set; }//产品品牌
            public string? Pro_model { get; set; }//产品型号
            public decimal? Details_monovalent { get; set; }//采购单价
            public decimal? Po_number { get; set; }//采购数量
            public decimal? Details_storage { get; set; }//已入库数
            public decimal? Details_uq { get; set; }//多余字段
            public decimal? Podet_retqty { get; set; }//退货数量
            public decimal? To_be_stored_qty { get; set; }// 新增字段：待入库数量
            public decimal? To_be_returned_qty { get; set; }// 新增字段：待退货数量
            public string? Location_code { get; set; }//库位
        }
    }
}
